/*******************************************************************************
 * Copyright (c) 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package com.niannian.util;

import com.niannian.db.MyDBUser;

import android.content.Context;

/**
 * @author CcCc
 * 
 */
public class UserInfoManager {
	private static MyDBUser userInfoDPB = null;

	public static MyDBUser getUserInfoInstance(Context ctx) {
		if (userInfoDPB == null) {
			userInfoDPB = new MyDBUser();
			userInfoDPB.init(ctx);
		}
		return userInfoDPB;
	}

	public static MyDBUser getUserInfoInstance() {
		if (userInfoDPB.id==0) {
			try {
				userInfoDPB.loadFromPref();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return userInfoDPB;
	}
}
